canvas_height = 320;
canvas_width = 600;
radius = canvas_width / 2;
x_change = new Array();
y_change = new Array();
x_change = [ 1.0, 0.742, 0.395, 0, 0.395, 0.742, 1.0 ];// dui x zuobiao zuo
														// zhuan huan
y_change = [ 0.5, 0.766, 0.940, 1, 0.940, 0.766, 0.5 ];

var xynode = new Array();
var pianyi = 20;

var clear = 1;// mei ji shu dao 5 ,qing 0.

for (var m = 0; m < 35; m++) {
	xynode[m] = new Array();
	colnum = parseInt(m / 5);
	x_changed = parseFloat(x_change[colnum]);
	y_changed = parseFloat(y_change[colnum]);
	if (m < 20) {
		xynode[m][0] = radius * (1 - 0.2 * clear * x_changed) + pianyi;
	} else {
		xynode[m][0] = radius * (1 + 0.2 * clear * x_changed) + pianyi;
	}
	xynode[m][1] = canvas_height - radius * 0.2 * clear * y_changed;
	xynode[m][2] = m + 1;
	// alert("x:"+xynode[m][0]+"y:"+xynode[m][1]);
	if (clear == 5) {
		clear = 0;
	}
	clear++;
}

function set_dot_tianjing(id) {
	var c = document.getElementById("coordiv");
	var cxt = c.getContext("2d");
	var x = parseInt(xynode[id][0]);
	var y = parseInt(xynode[id][1]);
	var num = parseInt(xynode[id][2]);
	cxt.fillStyle = "#00FF00";
	cxt.beginPath();
	if (id % 5 == 0) {
		cxt.font = "12px Arial";
		cxt.arc(x, y, 10, 0, Math.PI * 2, true);
	} else {
		cxt.font = "16px Arial";
		cxt.arc(x, y, 16, 0, Math.PI * 2, true);
	}
	cxt.closePath();
	cxt.fill();
	cxt.fillStyle = "#000000";
	cxt.fillText("" + num, x - 8, y + 4);
}

function show_tianjing() {
	// nodeid:0
	var c = document.getElementById("coordiv");
	var cxt = c.getContext("2d");
	cxt.fillStyle = "#a9a9a9";
	cxt.beginPath();
	cxt.arc(radius + pianyi, canvas_height - 10, 14, 0, Math.PI * 2, true);
	cxt.closePath();
	cxt.fill();
	cxt.fillStyle = "#000000";
	cxt.font = "16px Arial";
	cxt.fillText("" + 0, radius + pianyi - 5, canvas_height - 10 + 4);

	// col1:
	for (var m = 0; m < 35; m++) {
		var x = parseInt(xynode[m][0]);
		var y = parseInt(xynode[m][1]);
		var num = parseInt(xynode[m][2]);
		cxt.fillStyle = "#a9a9a9";
		cxt.beginPath();
		if (m % 5 == 0) {
			cxt.font = "12px Arial";
			cxt.arc(x, y, 10, 0, Math.PI * 2, true);
		} else {
			cxt.font = "16px Arial";
			cxt.arc(x, y, 16, 0, Math.PI * 2, true);
		}
		cxt.closePath();
		cxt.fill();
		cxt.fillStyle = "#000000";
		cxt.fillText("" + num, x - 8, y + 4);
	}
}

color = new Array("#408933", "#FF097F", "#5CACEE", "#228822", "#0F6EB4",
		"#FF3030", "#DEB807", "#68AF95", "#0AFF70", "#9F79EE", "#8DEEEE",
		"#8B8B00", "#050505", "#80CDCD", "#EECBAD", "#AAAAAA", "#66CDAA",
		"#54FF9F", "#F0B2AA", "#436EEE", "#4EEE94", "#EE9023", "#309023",
		"#09EE70", "#887800", "#770512", "#5397B0", "#C08912", "#d2d409",
		"#679012", "#e9b033", "#905620");

function paint_line(number) {
	var x = parseInt(number) * 5;
	for (var mm = 0; mm < 5; mm++) {
		var x1 = parseInt(xynode[x + mm][0]);
		var y1 = parseInt(xynode[x + mm][1]);
		if ((x + mm + 1) <= 34) {
			var x2 = parseInt(xynode[x + mm + 1][0]);
			var y2 = parseInt(xynode[x + mm + 1][1]);
		}
		// alert("x1:"+x1+" y1:"+y1+"\nx2:"+x2+" y2"+y2);
		var c = document.getElementById("coordiv");
		var ctx = c.getContext("2d");
		ctx.strokeStyle = color[number];
		ctx.lineWidth = 1;
		ctx.moveTo(x1, y1);
		ctx.lineTo(x2, y2);
		if (mm == 0) {
			ctx.moveTo(x1, y1);
			ctx.lineTo(radius + pianyi, canvas_height - 10);
		}
		ctx.closePath();
		if (mm != 4) {
			ctx.stroke();
		}
		ctx.fillStyle = color[number];
		ctx.beginPath();
		if (mm % 5 == 0) {
			ctx.font = "12px Arial";
			ctx.arc(x1, y1, 10, 0, Math.PI * 2, true);
		} else {
			ctx.font = "16px Arial";
			ctx.arc(x1, y1, 16, 0, Math.PI * 2, true);
		}
		ctx.closePath();
		ctx.fill();
		ctx.fillStyle = "#000000";
		var num = x + mm + 1;
		ctx.fillText("" + num, x1 - 8, y1 + 4);
	}
}